import { createRouter, createWebHashHistory } from "vue-router";
import MainLayout from "@/views/layouts/MainLayout.vue";
// import HomeView from "../views/HomeView.vue";

const routes = [
  {
    path: "/",
    redirect: { name: "login" },
  },
  {
    path: "/login",
    name: "login",
    component: () =>
      import(/* webpackChunkName: "auth" */ "../views/auth/LoginView.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () =>
      import(/* webpackChunkName: "auth" */ "../views/auth/RegisterView.vue"),
  },
  {
    path: "/forgotpassword",
    name: "forgotpassword",
    component: () =>
      import(
        /* webpackChunkName: "auth" */ "../views/auth/ForgotPasswordView.vue"
      ),
  },
  {
    path: "/mainLayout",
    component: MainLayout,
    children: [
      {
        path: "",
        redirect: { name: "home" },
      },
      {
        path: "home",
        name: "home",
        component: () =>
          import(/* webpackChunkName: "home" */ "../views/home/HomeView.vue"),
      },
      {
        path: "raim",
        name: "raim",
        component: () =>
          import(/* webpackChunkName: "raim" */ "../views/raim/RaimView.vue"),
      },
      {
        path: "ads",
        name: "ads",
        component: () =>
          import(/* webpackChunkName: "ads" */ "../views/ads/AdsView.vue"),
      },
      {
        path: "custom",
        name: "custom",
        component: () =>
          import(
            /* webpackChunkName: "custom" */ "../views/custom/CustomView.vue"
          ),
      },
      {
        path: "notice",
        name: "notice",
        component: () =>
          import(/* webpackChunkName: "auth" */ "../views/auth/NoticeView.vue"),
      },
      {
        path: "push",
        name: "push",
        component: () =>
          import(/* webpackChunkName: "auth" */ "../views/auth/PushView.vue"),
      },
      {
        path: "delivery",
        name: "delivery",
        component: () =>
          import(
            /* webpackChunkName: "auth" */ "../views/auth/DeliveryView.vue"
          ),
      },
      {
        path: "personinfo",
        name: "personinfo",
        component: () =>
          import(
            /* webpackChunkName: "auth" */ "../views/auth/PersonInfoView.vue"
          ),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
